\documentclass{article}

\usepackage{pgfplots}

\pgfplotsset{compat=1.13}

\begin{document}


\long\def\PLOT[#1]{%
	\addplot[point meta=explicit symbolic,mesh/color input=explicit,#1]
	coordinates {
	(0,0) [color=red] (1,0) [color=blue] (2,0) [color=yellow]

	(0,1) [color=black] (1,1) [color=brown] (2,1) [color=magenta]

	(0,2) [color=green] (1,2) [color=red] (2,2) [color=white]
	};
}%

\begin{tikzpicture}
	\begin{axis}[
		enlargelimits=false,
	]

	\PLOT[imagesc]

	\PLOT[mark=*,%scatter,
		mark size=4pt,only marks]
		
	\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
	\begin{axis}[
		enlargelimits=false,
		imagesc,
	]

	% the global style is actually unsupported... so this test
	% requires to set 'color=mapped color' :
	\PLOT[color=mapped color]

	\PLOT[mark=*,%scatter,
		mark size=4pt,only marks]
		
	\end{axis}
\end{tikzpicture}

\end{document}

